<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStaffTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('staff', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('company_id')->comment('所属公司id');
            $table->integer('dept_id')->comment('部门id');
            $table->string('name',20)->comment('姓名');
            $table->string('mobile',64)->comment('电话');
            $table->string('email',255)->comment('邮箱')->nullable();
            $table->string('position',255)->comment('职位')->nullable();
            $table->string('employee_no',255)->comment('工号')->nullable();
            $table->integer('entry_time')->comment('入职时间')->nullable();
            $table->string('remarks',255)->comment('备注')->nullable();
            $table->tinyInteger('role_status')->default(2)->comment('超级管理员 1：是 2：否');
            $table->tinyInteger('type')->default(2)->comment('是否部门主管 1：是 2：否');
            $table->tinyInteger('status')->default(0)->comment('是否删除 1：是 0：否');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
        });
         DB::statement("ALTER TABLE `staff` comment '员工表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('staff');
    }
}
